using EasyAdmin.Admin.Entity.Entities;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace EasyAdmin.Admin.Application.Services
{
    public interface ISysRoleService
    {
        /// <summary>
        /// 获取角色列表
        /// </summary>
        /// <param name="keyword">搜索关键词</param>
        /// <returns>角色列表</returns>
        Task<List<SysRole>> GetRoleListAsync(string keyword = null);

        /// <summary>
        /// 获取角色信息
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <returns>角色信息</returns>
        Task<SysRole> GetRoleByIdAsync(int roleId);

        /// <summary>
        /// 创建角色
        /// </summary>
        /// <param name="role">角色信息</param>
        /// <returns>创建结果</returns>
        Task<(bool Success, string Message)> CreateRoleAsync(SysRole role);

        /// <summary>
        /// 更新角色
        /// </summary>
        /// <param name="role">角色信息</param>
        /// <returns>更新结果</returns>
        Task<(bool Success, string Message)> UpdateRoleAsync(SysRole role);

        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <returns>删除结果</returns>
        Task<(bool Success, string Message)> DeleteRoleAsync(int roleId);

        /// <summary>
        /// 设置角色状态
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <param name="status">状态（0：禁用，1：启用）</param>
        /// <returns>设置结果</returns>
        Task<(bool Success, string Message)> SetRoleStatusAsync(int roleId, int status);

        /// <summary>
        /// 分配角色权限
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <param name="menuIds">菜单ID列表</param>
        /// <returns>分配结果</returns>
        Task<(bool Success, string Message)> AssignPermissionsAsync(int roleId, List<int> menuIds);

        /// <summary>
        /// 获取角色的权限ID列表
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <returns>权限ID列表</returns>
        Task<List<int>> GetRolePermissionsAsync(int roleId);
    }
}